<?php if( ! defined('BASEPATH')) exit('No direct script access allowed'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Add Employee Info</title>
</head>
<script>
	function doSubmit(){
		var un=document.getElementById("username").value.replace(/(^\s*)|(\s*$)/g, "");
		var repa=document.getElementById("repassword").value;
		var ena=document.getElementById("employena").value.replace(/(^\s*)|(\s*$)/g, "");
		var str1 = document.getElementById("email").value;
		var reg1 = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
		var str2 = document.getElementById("password").value;
		var reg2 = /^[0-9A-Za-z]{6,}$/;
		var em = reg1.test(str1);
		var pa = reg2.test(str2);;
		if(un!="" && pa && repa==str2 && ena!="" && em){
			document.getElementById("addform").submit();
		}
	}
	function validateUsername(){
		if(document.getElementById("username").value.replace(/(^\s*)|(\s*$)/g, "") != ""){
			document.getElementById("usernamelabel").style.visibility = "hidden";//不显示
		}else{
			document.getElementById("usernamelabel").style.visibility = "";//显示
			document.getElementById("username").focus();
		}
	}
	function validatePassword(){
		var str = document.getElementById("password").value;
		var reg = /^[0-9A-Za-z]{6,}$/;
		if(reg.test(str)){
			document.getElementById("passwordlabel").style.visibility = 'hidden';//不显示
		}else{
			document.getElementById("passwordlabel").style.visibility = "";//显示
			document.getElementById("passwordlabel").focus();
		}
	}
	function validateRePassword(){
		var v1 = document.getElementById("password").value;
		var v2 = document.getElementById("repassword").value;
		if(v1 != v2){
			document.getElementById("repasswordlabel").innerHTML = "<font color='red'>the two password isn't same!</font>";
		}else{
			document.getElementById("repasswordlabel").innerHTML = "";
		}
	}
	function validateEmployena(){
		if(document.getElementById("employena").value.replace(/(^\s*)|(\s*$)/g, "") != ""){
			document.getElementById("employenalabel").style.visibility = 'hidden';//不显示
		}else{
			document.getElementById("employenalabel").style.visibility = "";//显示
			document.getElementById("employena").focus();
		}
	}
	function validateEmail(){
		var str = document.getElementById("email").value;
		var reg = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
		if(reg.test(str)){
			document.getElementById("emaillabel").style.visibility = 'hidden';//不显示
		}else{
			document.getElementById("emaillabel").style.visibility = "";//显示
			document.getElementById("emailemail").focus();
		}
	}
</script>
<STYLE type=text/css>
{
FONT-SIZE
:
 
12
px


}
.gridView {
	BORDER-RIGHT: #bad6ec 1px;
	BORDER-TOP: #bad6ec 1px;
	BORDER-LEFT: #bad6ec 1px;
	COLOR: #566984;
	BORDER-BOTTOM: #bad6ec 1px;
	FONT-FAMILY: Courier New
}

.gridViewHeader {
	BORDER-RIGHT: #bad6ec 1px solid;
	BORDER-TOP: #bad6ec 1px solid;
	BACKGROUND-IMAGE: url(<?php echo base_url(); ?> images /bg_th.gif);
	BORDER-LEFT: #bad6ec 1px solid;
	LINE-HEIGHT: 27px;
	BORDER-BOTTOM: #bad6ec 1px solid
}

.gridViewItem {
	BORDER-RIGHT: #bad6ec 1px solid;
	BORDER-TOP: #bad6ec 1px solid;
	BORDER-LEFT: #bad6ec 1px solid;
	LINE-HEIGHT: 32px;
	BORDER-BOTTOM: #bad6ec 1px solid;
	TEXT-ALIGN: center
}

.cmdField {
	BORDER-RIGHT: 0px;
	BORDER-TOP: 0px;
	BACKGROUND-IMAGE: url(<?php echo base_url(); ?> images
	/bg_rectbtn.png);
	OVERFLOW: hidden;
	BORDER-LEFT: 0px;
	WIDTH: 67px;
	COLOR: #364c6d;
	LINE-HEIGHT: 27px;
	BORDER-BOTTOM: 0px;
	BACKGROUND-REPEAT: repeat-x;
	HEIGHT: 27px;
	BACKGROUND-COLOR: transparent;
	TEXT-DECORATION: none
}

.buttonBlue {
	BORDER-RIGHT: 0px;
	BORDER-TOP: 0px;
	BACKGROUND-IMAGE: url(<?php echo base_url(); ?> images
	/bg_button_blue.gif);
	BORDER-LEFT: 0px;
	WIDTH: 78px;
	COLOR: white;
	BORDER-BOTTOM: 0px;
	BACKGROUND-REPEAT: no-repeat;
	HEIGHT: 21px
}
</STYLE>
<BODY style="BACKGROUND-POSITION-Y: -100px; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/bg.gif); BACKGROUND-REPEAT: repeat-x">
	<DIV>
		<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
			<TBODY>
				<TR 
      	style="BACKGROUND-IMAGE: url(<?php echo base_url(); ?>/images/bg_header.gif); BACKGROUND-REPEAT: repeat-x" 
      		height=47>
					<TD width=10><SPAN 
        	style="FLOAT: left; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_hl.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"></SPAN></TD>
					<TD><SPAN 
        	style="FLOAT: left; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_hl2.gif); WIDTH: 15px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"></SPAN><SPAN 
        	style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; FLOAT: left; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_hb.gif); PADDING-BOTTOM: 10px; COLOR: white; PADDING-TOP: 10px; BACKGROUND-REPEAT: repeat-x; HEIGHT: 47px; TEXT-ALIGN: center; 0px: ">Add Staff</SPAN> <SPAN style="FLOAT: left; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_hr.gif); WIDTH: 60px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 47px"></SPAN></TD>
					<TD 
        	style="BACKGROUND-POSITION: 50% bottom; BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_rc.gif)" 
        	width=10></TD>
				</TR>
				<TR>
					<TD style="BACKGROUND-IMAGE: url(<?php echo base_url(); ?>images/main_ls.gif)">&nbsp;</TD>
					<TD style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; PADDING-BOTTOM: 10px; COLOR: #566984; PADDING-TOP: 10px; BACKGROUND-COLOR: white" vAlign=top align=left>
						<DIV>
							<TABLE class=gridView id=ctl00_ContentPlaceHolder2_GridView1 style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0 rules=all border=1>
								<form id="addform" action="<?php echo base_url(); ?>/employeInfoControl/doAdd" method="post">
									<TBODY>
										<TR>
											<TH scope=col>UserID:</TH>
											<TH scope=col><input type="text" id="username" name="username" value="" onblur="validateUsername()" /></TH>
											<TH scope=col><label id="usernamelabel"><font color='red'>username can not be null!</font> </label></TH>
										</TR>
										<TR>
											<TH scope=col>Password:</TH>
											<TH scope=col><input type="password" id="password" name="password" value="" onblur="validatePassword()" /></TH>
											<TH scope=col><label id="passwordlabel"><font color='red'>password shoud be more than 6 symbols</font> </label></TH>
										</TR>
										<TR>
											<TH scope=col>RePassword:</TH>
											<TH><input type="password" id="repassword" name="repassword" value="" onblur="validateRePassword()" /></TH>
											<TH><label id="repasswordlabel"></label></TH>
										</TR>
										<TR>
											<TH scope=col>Name:</TH>
											<TH scope=col><input type="text" id="employena" name="employena" value="" onblur="validateEmployena()" /></TH>
											<TH scope=col><label id="employenalabel"><font color='red'>please input the designer name</font> </label></TH>
										</TR>
										<TR>
											<TH scope=col>Email:</TH>
											<TH scope=col><input type="text" id="email" name="email" value="" onblur="validateEmail()" /></TH>
											<TH scope=col><label id="emaillabel"><font color='red'>please input a correct email address</font> </label></TH>
										</TR>
										<TR>
											<TH colspan="3" scope=col><input type="button" value="  add  " onclick="doSubmit()" /></TH>
										</TR>
										<TR>
											<TH colspan="3" scope=col><a href="<?php echo base_url(); ?>/employeInfoControl/index/">return</a></TH>
										</TR>
									</TBODY>
								</form>
							</TABLE>
						</DIV>
					</TD>
				</TR>
				</TALE>
				</DIV>

</BODY>
</HTML>
